Skip to content

fix(bin): accept legacy meta files without endpoint_task_id= in teardown validation - #4

Merged
marcusvpn1 merged 2 commits into
mainfrom
fm/fm-fm-teardown-refuses-legacy-herdr-tasks-m-4b
Aug 2, 2026
Merged

fix(bin): accept legacy meta files without endpoint_task_id= in teardown validation#4
marcusvpn1 merged 2 commits into
mainfrom
fm/fm-fm-teardown-refuses-legacy-herdr-tasks-m-4b

Conversation

@marcusvpn1

Copy link
Copy Markdown
Owner

Intent

Fix fm_backend_validate_task_endpoint to accept legacy herdr, zellij, orca, and cmux meta files that lack the endpoint_task_id= field, so older tasks that predate that field can be torn down instead of being refused forever. The tmux backend never had this check, relying instead on window naming convention. The fix changes the per-backend binding check from requiring an exact match to only refusing when endpoint_task_id= is present AND mismatches the task id, while the existing top-level guard still catches genuine cross-task binding mismatches.

What Changed

  • fm_backend_validate_task_endpoint in bin/fm-backend.sh now treats the per-backend endpoint_task_id= check for herdr, zellij, orca, and cmux as refuse-only-on-mismatch rather than requiring an exact match, so legacy meta files predating that field pass through instead of being refused forever; the existing top-level guard still catches genuine cross-task binding mismatches.
  • Extended tests/fm-teardown-endpoint-safety.test.sh with legacy-binding cases (herdr, zellij, orca, cmux meta files missing endpoint_task_id=) to cover the new behavior.
  • Updated docs/configuration.md to correct the stale claim that opaque non-tmux endpoints require a recorded endpoint_task_id= binding, describing the actual refuse-only-on-mismatch behavior.

Risk Assessment

✅ Low: The change is a well-scoped, mechanical loosening of four identical binding checks, fully matches the stated intent (legacy meta without endpoint_task_id= now passes, mismatches still refused via the pre-existing top-level guard), and is covered by new tests for each backend; the only issue found is harmless redundant/dead code.

Testing

Ran tests/fm-teardown-endpoint-safety.test.sh, the shell test suite covering fm_backend_validate_task_endpoint; all 5 assertions passed, including the newly added legacy-meta-file cases for herdr, zellij, orca, and cmux backends (missing endpoint_task_id= now validates and correctly selects backend/target) and the pre-existing mismatch-refusal case, confirming both required behaviors from the intent are satisfied with no regressions and a clean working tree.

Pipeline

Updates from git push no-mistakes

✅ **intent** - passed

✅ No issues found.

⏭️ **Rebase** - skipped

Push main to origin, or rebase your branch onto origin/main, before gating.

⚠️ **Review** - 1 info
  • ℹ️ bin/fm-backend.sh:455 - Per-backend binding checks for herdr, zellij, orca, and cmux (bin/fm-backend.sh:455, 474, 490, 513) now duplicate the top-level guard at bin/fm-backend.sh:439-442, which already refuses unconditionally on binding mismatch before the case statement runs. These per-backend blocks are unreachable dead code post-fix; safe to remove as a follow-up simplification, not a functional risk.
✅ **Test** - passed

✅ No issues found.

  • bash tests/fm-teardown-endpoint-safety.test.sh — all 5 test cases pass, including 'cleanup identity: valid and legacy tmux, Herdr, Zellij, Orca, and cmux records validate while every empty backend target refuses', which was extended in this commit with new legacy-binding assertions for herdr-legacy, zellij-legacy, orca-legacy, and cmux-legacy meta files (no endpoint_task_id= field)
  • Manual code inspection of bin/fm-backend.sh:439-514 confirming the top-level guard (line 439-441) still refuses any meta file where endpoint_task_id= is present and mismatches the task id, before backend-specific dispatch, satisfying the 'existing top-level guard still catches genuine cross-task binding mismatches' requirement
✅ **Document** - passed

✅ No issues found.

✅ **Lint** - passed

✅ No issues found.

✅ **Push** - passed

✅ No issues found.

… in teardown validation

fm_backend_validate_task_endpoint required an exact endpoint_task_id= match
for herdr, zellij, orca, and cmux backends, refusing teardown forever for
older tasks that predate that field. The tmux backend never had this check,
relying instead on window naming convention.

Change the per-backend binding check from a strict match to only refuse when
endpoint_task_id= is present AND mismatches the task id. Legacy meta files
with no endpoint_task_id= field now pass through, while genuine cross-task
binding mismatches are still caught by the existing top-level guard.
@marcusvpn1
marcusvpn1 force-pushed the fm/fm-fm-teardown-refuses-legacy-herdr-tasks-m-4b branch from bca6b25 to 9ac48ec Compare August 2, 2026 11:58
@marcusvpn1
marcusvpn1 merged commit 999d06b into main Aug 2, 2026
10 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant